//
//  TodayButtonViewController.m
//  SYiDaiy
//
//  Created by dllo on 16/9/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TodayButtonViewController.h"
#import "TAMacro.h"
#import "TodayTwoDetailViewController.h"
@interface TodayButtonViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>

@end

@implementation TodayButtonViewController
#pragma mark ------todayButton视图加载
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UICollectionViewFlowLayout *flow = [UICollectionViewFlowLayout new];
    flow.itemSize = CGSizeMake(SCREEN_WIDTH - 10, 30);

    self.view.frame = CGRectMake(5, 820, SCREEN_WIDTH - 10, 30);
    UICollectionView *todayButtoncollection = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flow];
    [self.view addSubview:todayButtoncollection];

    todayButtoncollection.delegate = self;
    todayButtoncollection.dataSource = self;
    [todayButtoncollection registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"todayButtoncollectionCell"];
}
#pragma mark ----集合视图的返回cell的方法
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"todayButtoncollectionCell" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor greenColor];
    return cell;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 1;
}

#pragma mark ------todayButton集合视图的点击方法
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    TodayTwoDetailViewController *twoDetailVC = [TodayTwoDetailViewController new];
    [self.navigationController pushViewController:twoDetailVC animated:YES];
    twoDetailVC.link_share = _newsArray[indexPath.row].link_share;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
